package com.林子祺.全名健康管理系统.entity.article.content.communicate;

import com.林子祺.全名健康管理系统.entity.article.content.comment.CurrentCommentData;
import com.林子祺.全名健康管理系统.util.AskStructure;
import com.林子祺.全名健康管理系统.util.CommentStructure;

import java.util.ArrayList;

public class CommData {

    static ArrayList<AskStructure> as = new ArrayList<>();

    public static void InputData(int id, String name, String ask, String askperson, int response, String anstext){
        as.add(new AskStructure(id,name,ask,askperson,response,anstext));
    }


    public static boolean OutputCommData(int number){
        if(number < as.size()){
            AskStructure p = as.get(number);
            CurrentCommData.id = p.getId();
            CurrentCommData.name = p.getName();
            CurrentCommData.ask = p.getAsk();
            CurrentCommData.askperson = p.getAskperson();
            CurrentCommData.response = p.getResponse();
            CurrentCommData.anstext = p.getAnstext();
            return true;
        }
        else
            return false;
    }

    public static void Refresh(){
        if(as.size() != 0)
            as.removeAll(as);
    }

}
